package com.shop.cereshop.app.dao.notice;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shop.cereshop.app.domain.notice.CereSystemUserNotice;
import com.shop.cereshop.app.domain.notice.SystemNoticeVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CereSystemUserNoticeMapper  extends BaseMapper<CereSystemUserNotice> {

    /**
     * 获取系统通知/公告列表
     * @param userId 用户ID
     * @return 列表
     */
    List<SystemNoticeVO> getSystemNoticePage(@Param("userId") Long userId);

    /**
     * 获取用户未读系统通知/公告数量
     * @param userId 用户ID
     * @return 数量
     */
    Long getUserUnreadNoticeCount(@Param("userId") Long userId);

    /**
     * 设置用户已读
     * @param userId 用户ID
     * @param noticeId 通知ID
     */
    void updateUserNoticeIsRead(@Param("userId") Long userId, @Param("noticeId") Long noticeId);

    /**
     * delete by primary key
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Long id);

//    /**
//     * insert record to table
//     * @param record the record
//     * @return insert count
//     */
//    int insert(CereSystemUserNotice record);

    /**
     * insert record to table selective
     * @param record the record
     * @return insert count
     */
    int insertSelective(CereSystemUserNotice record);

    /**
     * select by primary key
     * @param id primary key
     * @return object by primary key
     */
    CereSystemUserNotice selectByPrimaryKey(Long id);

    /**
     * update record selective
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(CereSystemUserNotice record);

    /**
     * update record
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(CereSystemUserNotice record);
}